<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateResearchCentersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('research_centers', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('research_name');
			$table->integer('user_quantity');
			$table->integer('subject_quantity');
			$table->integer('experiment_id')->unsigned()->index('experiment_id');
			$table->timestamps();

			$table->foreign('experiment_id')->references('id')->on('experiments');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('research_centers');
	}

}
